home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / funpopva.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  947 b   |  43 lines

  1. /*
  2. \funcref{fun\_pop\_var}{void fun\_pop\_var ()}
  3.     {}
  4.     {}
  5.     {getint16(), pop()}
  6.     {fun\_copy\_var()}
  7.     {funpopva.c}
  8.     {
  9.  
  10.         This function is called when an {\em op\_pop\_var} is encountered in
  11.         the binary makefile. Following the opcode a variable index is expected.
  12.         The logic of the function is as follows:
  13.  
  14.         \begin{itemize}
  15.  
  16.             \item The original contents of the variable are released if
  17.             necessary by calling {\em discard()}.
  18.  
  19.             \item The last used stack element is copied into the variable.
  20.  
  21.             \item The stack pointer is decremented to reflect the shrinking of
  22.             the stack.
  23.  
  24.         \end{itemize}
  25.  
  26.         Note that the memory associated with the stack variable remains
  27.         unchanged.
  28.  
  29.     }
  30. */
  31.  
  32. #include "icm-exec.h"
  33.  
  34. void fun_pop_var ()
  35. {
  36.     register VAR_
  37.         *dest;
  38.  
  39.     dest = getdest ();
  40.     *dest = discard (*dest);
  41.     *dest = pop ();
  42. }
  43.